#ifndef __STRINGUTIL_H_
#define __STRINGUTIL_H_
#include "KLib.h"




/**
Class full of static member functions that allow the easy manipulation of strings.
*/
class EXPORTEDCLASS StringUtil
{
protected:
	StringUtil ();
public:

	static String toLowerCase (const String& string);
	static void toLowerCase (String& string);

	static StringArray split (const String& str, Char delimiter);
	static StringArray splitMulti (const String& str, const String& delimeters);
	/** 
	Method to convert a floating point value to a String.
	@param value A floating point value
	*/
	static String toString (float value, u16 precision=3);
	/** 
	Method to convert an unsigned integer value to a String.
	@param value A floating point value
	*/
	static String toString (u32 value);
	/** 
	Method to convert an unsigned 16 bit integer value to a String.
	@param value An unsigned 16 bit integer value
	*/
	static String toString (u16 value);
	/** 
	Method to convert a 16 bit integer value to a String.
	@param value A 16 bit integer value
	*/
	static String toString (i16 value);
	/** 
	Method to convert a 32 bit integer value to a String.
	@param value A 32 bit integer value
	*/
	static String toString (i32 value);
	/** 
	Method to convert an unsigned 64 bit integer value to a String.
	@param value An unsigned 64 bit integer value
	*/
	static String toString (u64 value);
	/** 
	Method to convert a 64 bit integer value to a String.
	@param value A 64 bit integer value
	*/
	static String toString (i64 value);
	/** 
	Method to convert a double precision floating point value to a String.
	@param value A double precision floating point value point value
	*/
	static String toString (double value);
	static String toString (bool value);

	static String toString (const byte *data);

	static i32 parseInt (const String& string);
	static u32 parseUInt (const String& string);
	static float parseFloat (const String& string);
	static double parseDouble (const String& string);
	static bool parseBool (const String& string);
	//TODO: Make some more of these for the other datatypes


	static String makeString (const StringW& str);
	static String makeString (const StringA& str);
	static StringW makeUnicode (const String& anyStringType);
	static StringA makeANSI (const String& anyStringType);
	static StringW ansiToUnicode (const StringA& ansiString);
	static StringA unicodeToANSI (const StringW& unicodeString);

	/**
	Method to extract a file name from a full path
	@param filePath The file path containing the the filename
	@return The filename.
	*/
	static String getFileName (const String& filePath);
	static String getFileExtension (const String& filePath);

	static String urlDecode (const String& urlEncodedString);

    static u32 LevenshteinDistance (const String& str1, const String& str2);
};



#endif